#define ueditor(x)
	<script type="text/javascript">
		function getCtxPath(){
			return "";
		}
	</script>
	<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.parse.min.js"></script>
	
	#setLocal(val = x.value??'')
	#setLocal(token = "token_")
	#if (val != "")
	 	token = ""
	#end
	
	###加载编辑器的容器
    <script id="_#(x.index??)" data-type="ueditor" type="text/plain" style="width:100%">
        #(x.value??)
    </script>
    
    <script>
        function _#(x.index??)_initueditor(value){
        	if(value == undefined) value = '';
        	// ueditor
	        var _#(x.index??)_editor = UE.getEditor('_#(x.index??)',{
	        	toolbars: [["source", "undo", "redo", "bold", "italic", "underline", "fontborder", "insertunorderedlist", "insertorderedlist", "unlink", "link", "insertimage", "insertvideo", "removeformat", "justifyleft", "justifycenter", "justifyright", "fontsize", "fontfamily", "autotypeset",'inserttable', 'deletetable', "imageleft", "imageright", "imagecenter", "imagenone", "preview", "fullscreen",'wordimage']],
	        	readonly: #(readOnly??false),
	        	initialFrameHeight:180,
	        	textarea: "#(table??x.table).#(x.index??)"
	        });
	        _#(x.index??)_editor.ready(function() {
	        	_#(x.index??)_editor.execCommand('serverparam', {
					'uploadType': '#(x.uploadType)','typeCode':"#(x.typeCode)",'attachId':"#(x.attachId)",'table':"#(x.table)"
				});
	        	_#(x.index??)_editor.setContent(value);
			});
        }
	</script>	
#end
